using ServiceStack.Commands;
using System;
using System.Threading;
namespace ServiceStack.Support
{
	public class ActionExecHandler : ICommandExec, ICommand<bool>
	{
		private readonly Action action;
		private readonly AutoResetEvent waitHandle;
		public ActionExecHandler(Action action, AutoResetEvent waitHandle)
		{
			this.action = action;
			this.waitHandle = waitHandle;
		}
		public bool Execute()
		{
			this.action();
			this.waitHandle.Set();
			return true;
		}
	}
}
